package org.hughie.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hughie.common.MConstants;

import java.io.Serializable;

/**
 * @author hughie.cheng
 * @date 2024/2/29
 */
@Data
public class WebRespWrapper<T> implements Serializable {

    private T data;

    private String status;

    public static <T> WebRespWrapper<T> success(T data) {
        WebRespWrapper<T> wrapper = new WebRespWrapper<>();
        wrapper.setData(data);
        wrapper.setStatus(MConstants.SUCCESS);
        return wrapper;
    }
}
